cmake_minimum_required(VERSION 3.12)

# Pull in SDK (must be before project)
include(pico_sdk_import.cmake)
# Pull in FreeRTOS
include(FreeRTOS_Kernel_import.cmake)


project(raspberry-pico-lvgl)


# Initialize the SDK
pico_sdk_init() 


#添加编译子目录
add_subdirectory(driver/lcd)
add_subdirectory(driver/key)
add_subdirectory(lvgl)
add_subdirectory(freertos/portable/ThirdParty/GCC/RP2040)


#添加头文件目录
include_directories(driver/lcd)
include_directories(driver/key)
include_directories(driver/lcd/lib/Config)

#添加头文件目录LVG
include_directories(lvgl)
include_directories(lvgl/demos)
include_directories(lvgl/examples/porting)

#添加头文件目录
include_directories(freertos)
include_directories(freertos/include)
include_directories(freertos/portable/ThirdParty/GCC/RP2040/include)

add_executable(raspberry-pico-lvgl
    main.c
)

# Add pico_stdlib library which aggregates commonly used features
#target_link_libraries(raspberry-pico-lvgl lvgl lvgl_demos lvgl_examples lcd LCD OLED Infrared Icm20948 GUI Fonts Config pico_stdlib hardware_spi)


target_link_libraries(raspberry-pico-lvgl  
        lvgl_demos 
        lvgl_examples
        FreeRTOS-Kernel 
        FreeRTOS-Kernel-Heap4
        LCD_DRV  
        KEY_DRV
        pico_stdlib
        pico_multicore )

# create map/bin/hex/uf2 file in addition to ELF.
pico_add_extra_outputs(raspberry-pico-lvgl)

